#!/bin/bash

if [ -z "${TEST_GROUP}" ]; then
  TEST_GROUP="core"
fi

if [ -z "${JDK}" ]; then
  JDK="11"
fi
COMPOSE_FILE="integration/docker-compose-jdk${JDK}.yml"

docker compose -f ${COMPOSE_FILE} down && \
  docker network prune -f && \
  docker compose -f ${COMPOSE_FILE} pull && \
  TEST_GROUP="${TEST_GROUP}" docker compose -f ${COMPOSE_FILE} up --build --abort-on-container-exit --attach ldaptive
